{include file="public/top"}

{notempty name="nav"}
{volist name="nav" id="vo"}
{if condition="$cur eq $vo.tag"}
{volist name="vo.show" id="v"}
    <img src="{$v.thumb|geturl}" width="100%" alt="{$v.title}" />
{/volist}
{/if}
{/volist}
{/notempty}

<div id="page">
	<div class="leftList">
    	<div class="title">下载中心</div>
        <ul>
            {volist name="download_cate" id="vo"}
            <li {if condition="$vo.id eq $cate_id"} class="on" {/if}><a href="{:url('index/download/index',['cate_id'=>$vo.id])}" title="{$vo.name}">{$vo.name}</a>
                {notempty name="vo.cate2"}
                <div class="hide">
                    {volist name="vo.cate2" id="v2" key="k2"}
                    <p>
                        <b>
                            <a href="{:url('index/download/index',['cate_id'=>$v2.id])}">{$v2.name} {notempty name="v2.cate3"}|{/notempty}</a>
                        </b>
                        {notempty name="v2.cate3" }
                        <i>
                            {volist name="v2.cate3" id="v3" key="k3"}
                            <span><a href="{:url('index/download/index',['cate_id'=>$v3.id])}">{$v3.name} &nbsp; {if condition="$k3 neq count($v2.cate3)"}|{/if}</a></span>
                            {/volist}
                        </i>
                        {/notempty}
                    </p>
                    {/volist}
                </div>
                {/notempty}
            </li>
            {/volist}
        </ul>
    </div>
    
    <div class="rightCon">
    	<div class="crumbs">
        	您目前所在位置： <a href="" >首页</a> &nbsp; » &nbsp; 下载中心  &nbsp; » &nbsp; {$cate_id|get_download_cate_name}        </div>
        
        <div class="download">
        	<ul>
                
        	   {volist name="$download" id="vo"}
            	<li >
                	<a href="/public{$vo.pdf_url|geturl}" download="{$vo.title}" onclick="return check_users('download',{$vo.pdf_url})"   title="{$vo.title}"><div class="title">
                    	<h1>{$vo.title}</h1>
                        <h2></h2>
                    </div></a>  
                    
                    <div class="pic">
                    	<a href="/public{$vo.pdf_url|geturl}" download="{$vo.title}" onclick="return check_users('download',{$vo.pdf_url})"   title="{$vo.title}"><img src="{$vo.thumb|geturl}" ></a>
                        <p></p>
                    </div>
                    
                    <div class="pdf"><a href="/public{$vo.pdf_url|geturl}" download="{$vo.title}" onclick="return check_users('download',{$vo.pdf_url})"    title="{$vo.title}">详细参数（PDF）</a></div>
                </li>
           	    {/volist}     		   
           	                
            </ul>
        </div>
        <div class="pages" style="clear: both;">
            <ul>
	          {$pager}
            </ul>
        </div>    
    </div>
</div>

{include file="public/bottom"}
</body>
</html>

<script type="text/javascript">
    function check_users(path,id)
    {
        var flag = false;
        $.ajax({
            url:"{:url('index/common/download')}",
            data:{'path':path,'id':id},
            type:'post',
            async: false,
            dataType:"json",
            success:function(res) {
                if(res.code == 1) {
                    alert(res.msg);
                    flag = false;
                } else {
                    flag = true;
                }
            }
        });
        return flag;
    }
</script>